/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package mum.edu.cs.waa.assignment.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import mum.edu.cs.waa.assignment.model.Database;

/**
 *
 * @author teke
 */
public class AppStartUpListener implements ServletContextListener{

    @Override
    public void contextInitialized(ServletContextEvent sce) {
       
        Database db= Database.getDatabase();
        sce.getServletContext().setAttribute("Database", db);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        sce.getServletContext().removeAttribute("Database");
    }
    
}
